﻿using System;
using System.Collections.Generic;

namespace FizzBuzzGenerator
{
    /// <summary>
    /// This class writes the tokens on the console. 
    /// </summary>
    public class TokenConsoleWriter : AbstractTokenGenerator
    {
        /// <summary>
        /// Initializes base contructor with values passed. 
        /// </summary>
        /// <param name="start">Number to start</param>
        /// <param name="end">Number to end</param>
        public TokenConsoleWriter(int start, int end) : base(start, end)
        {
            
        }
        /// <summary>
        /// Initializes base contructor with values passed. 
        /// </summary>
        public TokenConsoleWriter()
        {

        }

        /// <summary>
        /// Initializes base contructor with values passed. 
        /// </summary>
        /// <param name="start">Number to start</param>
        /// <param name="end">Number to end</param>
        /// <param name="divisibleBy3Token">Custom token for divisible by 3 values. </param>
        /// <param name="divisibleBy5Token">Custom token for divisible by 5 values.</param>
        /// <param name="divisibleBy3And5Token">Custom token for divisible by 5 and 3 values.</param>
        /// <param name="notDivibleToken">Custom token for values not divisible by 3 or 5. </param>
        public TokenConsoleWriter(int start, int end, string divisibleBy3Token, string divisibleBy5Token, string divisibleBy3And5Token, string notDivibleToken)
            : base(start, end, divisibleBy3Token, divisibleBy5Token, divisibleBy3And5Token, notDivibleToken)
        {

        }

        /// <summary>
        /// Override to write tokens on console. 
        /// </summary>
        public override void GenerateFizzBuzzOutput()
        {
            foreach (string s in GetTokens())
            {
                Console.WriteLine(s);
            }
        }
        
        /// <summary>
        /// Gets list of tokens 
        /// </summary>
        /// <returns>List of tokens</returns>
        public List<string> GetTokens()
        {
            return GenerateTokens(); 
        }
    }
}
